﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TemplateWeb.Models.ViewModels.GroupViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
    function ValidateLogin() {
        var username = document.getElementsByName("username").item(0);
        if (username.value == "") {
            alert("Bạn chưa nhập tên đăng nhập");
            return false;
        }
        var password = document.getElementsByName("password").item(0);
        if (password.value == "") {
            alert("Bạn chưa nhập mật khẩu");
            return false;
        }
        return true;
    }

    <% if(ViewData["error"] != null && ViewData["error"] != string.Empty){ %>
        alert("<%= ViewData["error"] %>");
    <% } %>
</script>

<div class="content_panel">
    <div class="box_center">
	    <div class="title"><span>Đăng nhập</span><div class="bg"><img src="../../Content/Images/Home/bg_title_right.png"></div></div>
	    <div class="content">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                    <tr>
                    <td valign="top">
                    <!-- MAIN -->

                        <% using (Html.BeginForm("LogOn2", "Account", FormMethod.Post, new { onsubmit = "return ValidateLogin();" }))
                           { %>
			            <table width="100%" border="0" cellpadding="0" cellspacing="0" style="text-align:left">
			                <tbody>
                                <tr><td colspan="2">&nbsp;</td></tr>
			                    <tr>
				                    <td valign="top"><div style="margin: 5px 5px 5px 10px;"><b>Username *</b></div></td>
				                    <td valign="top">
                                        <div style="margin: 5px 10px 5px 5px;">
                                            <%= Html.TextBox("username", string.Empty, new { @style = "width: 200px;" })%>
                                        </div>
                                    </td>
			                    </tr>
			                    <tr>
				                    <td valign="top"><div style="margin: 5px 5px 5px 10px;"><b>Password *</b></div></td>
				                    <td valign="top">
                                        <div style="margin: 5px 10px 5px 5px;">
                                            <%= Html.Password("password", string.Empty, new { @style = "width: 200px;" })%>
                                        </div>
                                    </td>
			                    </tr>
                                <tr>
						            <td height="20" style="width: 130px">
						            </td>
						            <td height="20">
							            <div style="margin: 5px 10px 5px 5px;">
								            <br/>
                                            <input type="submit" name="sbt" id="sbt" value="Đăng nhập" style="background-image: url(../../../Content/Images/Home/bgbutton.jpg); color: #FFFFFF; font-size: 16px; font-weight: bold; border: 1px #DBDBDB solid; height: 30px; cursor:pointer;" />
								            <p>
								            </p>
							            </div>
						            </td>
					            </tr>
                            </tbody>
			                <!-- MAIN END -->
                        </table>
                    <% } %>
	            </td></tr>
	            </tbody>
            </table>
        </div>
    </div>
</div>
</asp:Content>
